<style>
    .layui-form .layui-form-item .layui-inline .layui-form-label {
        width: 200px;
        font-size: 18px;
        font-weight: bold;
    }
    .layui-form .layui-form-item .layui-inline .layui-input-inline input{
        width: 400px;
        font-size: 16px;
    }
</style>
<form class="layui-form  seller-alone-form" id="userAdd" style="padding:20px;height: 600px;">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>
            <a href="{:url('index')}" style="color: #428bca;font-weight:bold;" >User List</a> / 拒付比例更新(All)
        </legend>
    </fieldset>
    <br/>
    <br/>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">拒付比例(默认)：</label>
            <div class="layui-input-inline" style="width: 300px;">
                <input type="text" name="currey_rate" value="{$currey_rate*100} %"
                       readonly maxlength="50" style="border: 0px;color: red;font-size: 25px;"
                       lay-verType="tips"  class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">更新汇率：</label>
            <div class="layui-input-inline">
                <input type="text" name="new_rate" lay-verify="required_en" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width: auto;height:60px;color: red;float: left">
                填写规则:如果是1%,填写0.01; 是2%,填写0.02 以此类推<br>
            </label>
        </div>
    </div>
    <div class="layui-form-item" style="padding-top: 100px;">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit lay-filter="save">confirm</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
        </div><br /><br />
    </div>
<!--    <div class="layui-form-item">-->
<!--        <table id="userTable" lay-filter="test"></table>-->
<!--    </div>-->
</form>
<script>
    layui.use(['form','table'], function () {
        var form = layui.form;

        // var tableIn = layui.table.render({
        //     elem: '#userTable',
        //     height: 'full-139',
        //     cellMinWidth: '80',
        //     url: "{:url('user/rateList')}?_ajax=1",
        //     id: 'userTable',
        //     cols: [[
        //         // {type:'checkbox'},
        //         { type: 'numbers'},
        //         { field: 'id', title: 'id', width:90},
        //         { field: 'username', align: 'left', style:'font-weight:bold;' , title: 'User Name',templet:'#redict',width:250},
        //         { field: 'balance', title: '余额($)', align:"right",width:130,
        //             style:'color:#FF5722;font-weight:bold', totalRow: true},
        //         { field: 'usa_rate', title: '美元汇率', width:100},
        //         { field: 'desc', title: '备注', align:"right",width:150},
        //         { field: 'check_time', align: 'center', title: 'Active Time' , width: 160,
        //             templet: function (d) {
        //                 return layui.util.toDateString(d.ctime * 1000, "yyyy-MM-dd HH:mm:ss");
        //             }
        //         }
        //     ]],
        //     page: true,
        //     limit: 50,
        //     limits: [50,  500 ,1000 , 2000],
        // });

        form.on('submit(save)', function(data){
            JsPost("{:url('userDecRate')}", data.field, function(res){
                if (res.code > 0) {
                    layer.msg(res.msg, {time: 1500, icon: 1}, function () {
                        window.location.href = "{:url('index')}";
                    });
                } else {
                    layer.msg(res.msg, {time: 1500, icon: 2});
                }
            });
        });
    });
</script>
